const panels = document.querySelectorAll('.panel')

panels.forEach( (panel) => {
    panel.addEventListener('click', () => {
        removeActive()
        if(panel.classList.value.search(/active/) === -1){
            panel.classList.add('active')
        }
    })
})
var removeActive = function() {
    panels.forEach(panel => {
        panel.classList.remove('active')
    })
}